-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
save_analysis: Dump data only if get_path_data doesn't fail to resolve a path. #37144
Conversation
Sadly, its a pain to test save-analysis in any meaningful way. If you wanted a follow-up thing to work on, you could add a version of the run-make smoke test that has an error in it so that we're at least testing the error case to some extent. |
scope: vrd.scope, | ||
qualname: String::new() | ||
}.lower(self.tcx)); | ||
if let Some(path_data) = path_data { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than an if let
here, it is probably better to do an early return - I don't think we want to hit the following match statement and it means there is less rightward drift.
@bors: r+ rollup |
📌 Commit 88b031e has been approved by |
save_analysis: Dump data only if get_path_data doesn't fail to resolve a path. Solves rust-lang#37126 Dump data only if `get_path_data` doesn't fail to resolve a path. `get_path_data` returns `None` when it have to deals with `Def::Err`, which is used as placeholder for a failed resolution. Tell me if this is good enough, maybe I have to add some tests ? r? @nrc
save_analysis: Dump data only if get_path_data doesn't fail to resolve a path. Solves rust-lang#37126 Dump data only if `get_path_data` doesn't fail to resolve a path. `get_path_data` returns `None` when it have to deals with `Def::Err`, which is used as placeholder for a failed resolution. Tell me if this is good enough, maybe I have to add some tests ? r? @nrc
Solves #37126
Dump data only if
get_path_data
doesn't fail to resolve a path.get_path_data
returnsNone
when it have to deals withDef::Err
, which is used as placeholder for a failed resolution.Tell me if this is good enough, maybe I have to add some tests ?
r? @nrc